package com.woniu.order.client;

import com.woniu.order.client.param.AdditionalCommentParam;
import com.woniu.order.client.param.AddCommentParam;
import com.woniu.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;


/**
* name是项目名，contextId是client的名字
*/
@FeignClient(contextId = "commentManageClient",name="order")
public interface CommentManageClient {

    /**
     * 评论
     * @param addCommentParam
     * @return
     */
    @PostMapping("addComment")
    public Result addComment(@RequestBody AddCommentParam addCommentParam);

    /**
     * 追加评论
     * @param additionalCommentParam
     * @return
     */
    @PutMapping("additionalComment")
    public Result addAdditionalComment(@RequestBody AdditionalCommentParam additionalCommentParam);

    /**
     * 删除评论
     * @param commentId
     * @return
     */
    @DeleteMapping("deleteComment")
    public Result deleteComment(@RequestParam("commentId") Integer commentId);

    /**
     * 上传文件
     * @param file
     * @return
     * @throws Exception
     */
    @PostMapping("upload")
    public Result uploadFile(@RequestPart("file") MultipartFile file) throws Exception;

}
